﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entity;

public partial class display_reviews : SitePublicBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string productId = Request.QueryString["productId"];
            string productName = Request.QueryString["productName"];

            if (!String.IsNullOrEmpty(productId) && !String.IsNullOrEmpty(productName))
            {
                LoadProductReviews(productId);
            }
        }
    }
    private void LoadProductReviews(string productId)
    {
        try
        {
            int prodID = Convert.ToInt32(productId);
            IList<TblProductReview> reviews = TblProductReview.GetTblProductReviewByProductId(prodID);

            rptProductReviews.DataSource = reviews;
            rptProductReviews.DataBind();
           
        }
        catch (Exception ex)
        {
            throw ex;
        }

    }

    protected void rptProductReviews_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        
    }
}